var express = require('express');
var app = express();

// respond with "hello world" when a GET request is made to the homepage
app.get('/', function(req, res) {
  res.send('hello world');
})
app.get("/qmh-pic", function (req, res) {
  console.log("/qmh-pic");

  var json = [
    {src: "images/demo/waterfall-1-294-415.png", type: "pic"},
    {src: "images/demo/waterfall-2-295-176.png", type: "pic"},
    {src: "images/demo/waterfall-3-294-360.png", type: "pic"},
    {src: "images/demo/waterfall-4-295-184.png", type: "pic"},
    {src: "images/demo/waterfall-5-295-192.png", type: "pic"},
    {src: "images/demo/waterfall-6-295-192.png", type: "pic"},
    {src: "images/demo/waterfall-1-294-415.png", type: "pic"},
    {src: "images/demo/waterfall-2-295-176.png", type: "pic"},
    {src: "images/demo/waterfall-3-294-360.png", type: "pic"},
    {src: "images/demo/waterfall-4-295-184.png", type: "pic"},
    {src: "images/demo/waterfall-5-295-192.png", type: "pic"},
    {src: "images/demo/waterfall-6-295-192.png", type: "pic"}
  ];

  setTimeout(function () {
    res.send("var result = " + JSON.stringify(json) + ";" + req.query.callback + "(result);");
  }, 2000);
});

app.get('/t', function (req, res) {
  console.log("/t");
  res.send("`````````````");
});

app.listen(8080);
